const User = {
    //查询手机号存在不存在
    queryUserTel( options = {} ){
        console.log('select * from user where tel='+options.tel+'');
        return 'select * from user where tel='+options.tel+'';
    },
    //查询用户的密码对不对
    queryUserPwd( options = {} ){
        return 'select * from user where (tel = '+options.tel+') and pwd = '+options.pwd+'';
    },
    //增加一个用户数据
    insertUser( options ){
        let tel = options.tel;
        let pwd = options.pwd;
        let jwt = require('jsonwebtoken');
        
        let token = jwt.sign({
            name:tel
        },'xiaoluxian',{
            expiresIn:60
        });
        
        
        return 'insert into user (tel,pwd,nickName,imgUrl,token) values ("'+tel+'","'+pwd+'","'+tel+'","/images/nick.jpg","'+token+'")';
    }
}

exports = module.exports = User;